<?php

class Validate{
	const USERNAME = '/^[a-zA-Z\d]+$/';
	const PASSWORD = '/^.*(?=.{6,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/';
	
	public function IsValidUsername($username)
	{
		if(preg_match($this::USERNAME, $username) && strlen($username) <= 50)
		{
			return true;
		}
		return false;
	}
	
	public function IsValidPassword($password)
	{
		if(preg_match($this::PASSWORD, $password) && strlen($password) <= 50){
			return true;
		}
		return false;
	}
}
